package com.xsr.controller;

import com.xsr.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project springMvcday03
 * @date 2022/9/15 17:53
 */
@Controller
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private UserService userService;
    @RequestMapping("/selectAll")
    public ModelAndView selectAll(){
     List<String> username= userService.selectAll();
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("list",username);
        modelAndView.setViewName("hhh.jsp");
return modelAndView;
    }
}
